package AM;

import robocode.*;
import robocode.HitRobotEvent;
import robocode.ScannedRobotEvent;
import static robocode.util.Utils.normalRelativeAngleDegrees;

import java.awt.*;

// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html

/**
 * RavenGuard - a robot by NW
 */
public class RavenGuard extends AdvancedRobot {
	double BHeight;
	double BWidth;
	boolean Spot = false;
	
	public void run() {
		BHeight = getBattleFieldHeight();
		BWidth = getBattleFieldWidth();
		
		setBodyColor(new Color(0,0,0));
		setGunColor(new Color(25,25,12));
		setRadarColor(new Color(255,255,255));
		setBulletColor(Color.red);
		setScanColor(new Color(16,16,16));
		
		//setAdjustRadarForGunTurn(true);
								
		while(true) {
			// Replace the next 4 lines with any behavior you would like
			if (BHeight - getY()){
				
			}
			else{
				setTurnRight(1000);
				ahead(1000);
				setTurnGunRight(180);
			}
		}
	}


	public void onScannedRobot(ScannedRobotEvent e) {
		// Replace the next line with any behavior you would like
		fire(2);
				
	}


	public void onHitByBullet(HitByBulletEvent e) {
		// Replace the next line with any behavior you would like
		
	}

	public void onBulletHit(BulletHitEvent e){
		
	}

	public void onHitWall(HitWallEvent e) {
		// Replace the next line with any behavior you would like
		setTurnLeft(180);
		setBack(1000);
	}

		public void onHitRobot(HitRobotEvent e) {
		if (e.getBearing() > -10 && e.getBearing() < 10) {
			fire(3);
		}
	}	
}
